/**
 * 
 */
package abstractfactories.store;

import abstractfactories.factory.AbstractFactory;
import abstractfactories.factory.impl.ConcreteFactory1;
import abstractfactories.factory.impl.ConcreteFactory2;
import abstractfactories.product.ProductA;
import abstractfactories.product.ProductB;
import abstractfactories.product.ProductC;

/**
 * @author hoannguyen
 * 
 */
public class Store {

	private AbstractFactory concreteFactory1;
	private AbstractFactory concreteFactory2;

	public Store() {

		concreteFactory1 = new ConcreteFactory1();
		concreteFactory2 = new ConcreteFactory2();
	}

	public void orderProduct() {

		ProductA concreteProductA1 = concreteFactory1.createProductA();
		concreteProductA1.productAMethod1();
		concreteProductA1.productAMethod2();

		ProductB concreteProductB1 = concreteFactory1.createProductB();
		concreteProductB1.productBMethod1();
		concreteProductB1.productBMethod2();

		ProductC concreteProductC1 = concreteFactory1.createProductC();
		concreteProductC1.productCMethod1();
		concreteProductC1.productCMethod2();
		
		ProductA concreteProductA2 = concreteFactory2.createProductA();
		concreteProductA2.productAMethod1();
		concreteProductA2.productAMethod2();

		ProductB concreteProductB2 = concreteFactory2.createProductB();
		concreteProductB2.productBMethod1();
		concreteProductB2.productBMethod2();
		
		ProductC concreteProductC2 = concreteFactory2.createProductC();
		concreteProductC2.productCMethod1();
		concreteProductC2.productCMethod2();
	}
}
